#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QFile>
#include <QMessageBox>
#include <QFileInfo>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QVideoWidget>
#include <QGraphicsVideoItem>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_btn_open_clicked();

    //自定义槽函数
    void onStateChanged(QMediaPlayer::State stat);
    void onDurationChanged(qint64 duration);
    void onPositionChanged(qint64 position);


    void on_btn_play_clicked();

    void on_btn_turn_of_sound_clicked();

private:
    Ui::MainWindow *ui;

    QMediaPlayer * player;
    QGraphicsVideoItem *videoItem;
    QString durationTime;
    QString positionTime;
};

#endif // MAINWINDOW_H
